package org.warehouse.service;

import java.util.List;

import org.warehouse.entity.Group;
import org.warehouse.entity.Product;
import org.warehouse.util.Sort;

/**
 * Represent of middle-tear
 */
public interface IService {
	/**
	 * Returns all groups
	 * 
	 * @return list of {@link Group}
	 */
	List<Group> getGroups();

	/**
	 * Gets count of pages by id of group
	 * 
	 * @param groupId id of group
	 * @return session.setAttribute(Keys.PAGE_START_INDEX_OF_KEY, 1);
	 */
	int getCountOfPages(int groupId);

	/**
	 * Filters products by sporting of name and price fields' for defined group and page 
	 * @param groupId id of group
	 * @param currentPage number of page which is displayed on the screen
	 * @param sortByName sort ordering of name field
	 * @param sortByPrice sort ordering of price field
	 * @param lastSortColumnName serves for ordering of sort fields
	 * @return filtered list of {@link Product}
	 */
	List<Product> getProducts(int groupId, int currentPage, Sort sortByName, Sort sortByPrice, String lastSortColumnName);

}
